package com.auto.web;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.auto.util.LOG;
import com.google.code.kaptcha.Constants;

/**
 * Handles requests for the application home page.
 */
@Controller
@SessionAttributes(Constants.KAPTCHA_SESSION_KEY)
public class HomeController {

	@RequestMapping("app/login.do")
	public String login(@RequestParam String kaptcha,
			@ModelAttribute(Constants.KAPTCHA_SESSION_KEY) String kap, HttpSession hs) {
		LOG.info("用户输入验证码:{}, 正确验证码:{}", kaptcha, kap);
		return "index";
	}
}
